package com.zy.explore.design.patterns.observer;

/**
 * 电子邮件观察者
 *
 * @author ZY
 * @date 2021/11/02
 */
public class EmailObserver implements Observer{
    /**
     * 做相应的事件处理
     */
    @Override
    public void doEvent(int state) {
        int sendEmailState = 2;
        if (state == sendEmailState) {
            System.out.println("被观察者状态为：" + state + " 发送电子邮件");
        }
    }
}
